﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Collections;
using System.Security;
using System.Security.Cryptography;
using System.Text;
using System.Data.SqlClient;

/// <summary>
/// Summary description for WebData
/// </summary>
public class WebData : DataLibrary.DataContext
{
    public WebData()
        : base(global::System.Configuration.ConfigurationManager.ConnectionStrings["damiConnectionString"].ConnectionString)
	{
	    	
	}

    //Mã hoá mật khầu User
    public string EncodeMD5(string Pass)
    {
        MD5CryptoServiceProvider m_sp = new MD5CryptoServiceProvider();
        byte[] Array = System.Text.Encoding.UTF8.GetBytes(Pass);
        Array = m_sp.ComputeHash(Array);
        StringBuilder sb = new StringBuilder();
        foreach (byte b in Array)
        {
            sb.Append(b.ToString("X2"));
        }
        return sb.ToString();
    }

}